import { Component } from 'react'; 
import Layout1 from '../../layouts/Layout1.js';
import { Link } from 'react-router-dom'

export default class Rtest02 extends Component {
	componentDidMount(nextProps, prevState) {
		console.log(this.props.location.query);
	}
	fn1 = () => {
		console.log('fn1');
		this.props.history.push({pathname:"/Rtest01"});
	}
	fn2 = () => {
		console.log('fn2');
		this.props.history.push({pathname:"/Rtest01", query: {name : 'aa2' }});
	}
    render() {
    	return (
			<Layout1>
			    <span onClick={this.fn1}>前往Rtest01-不带参</span>
			    <hr />
			    <span onClick={this.fn2}>前往Rtest01-带参</span>
			</Layout1>
		);
    }
};
